package com.bzm.controller.openfeign;

import javax.servlet.http.HttpServletRequest;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.bzm.common.entity.HttpCode;
import com.bzm.common.entity.JsonResult;
import com.bzm.openfeign.goods.GoodsInfoFeignClient;

@Controller
@RequestMapping("/openFeignDemo")
public class OpenFeignDemoController {

    @Autowired
    private GoodsInfoFeignClient goodsInfoFeignClient;

    @RequestMapping("/getDemo")
    @ResponseBody
    public JsonResult<Object> getDemo(HttpServletRequest request){
        String serverPort = goodsInfoFeignClient.getServerPort("123456.....");
        return new JsonResult<Object>(serverPort, HttpCode.SUCCESS);
    }
}
